Optimal. Leaf size=26 \[ x \cos (a-c)+\frac {\log (\cos (c+b x)) \sin (a-c)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4679, 3556, 8}
\begin {gather*} \frac {\sin (a-c) \log (\cos (b x+c))}{b}+x \cos (a-c) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3556
Rule 4679
Rubi steps
\begin {align*} \int \cos (a+b x) \sec (c+b x) \, dx &=\cos (a-c) \int 1 \, dx-\sin (a-c) \int \tan (c+b x) \, dx\\ &=x \cos (a-c)+\frac {\log (\cos (c+b x)) \sin (a-c)}{b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 26, normalized size = 1.00 \begin {gather*} x \cos (a-c)+\frac {\log (\cos (c+b x)) \sin (a-c)}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(160\) vs.
\(2(26)=52\).
time = 0.41, size = 161, normalized size = 6.19
method | result | size |
risch | \(x \,{\mathrm e}^{i \left (a -c \right )}-2 i \sin \left (a -c \right ) x -\frac {2 i \sin \left (a -c \right ) a}{b}+\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+{\mathrm e}^{2 i \left (a -c \right )}\right ) \sin \left (a -c \right )}{b}\) | \(66\) |
default | \(\frac {\frac {\frac {\left (-\sin \left (a \right ) \cos \left (c \right )+\cos \left (a \right ) \sin \left (c \right )\right ) \ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2}+\left (\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right ) \arctan \left (\tan \left (b x +a \right )\right )}{\left (\cos ^{2}\left (c \right )+\sin ^{2}\left (c \right )\right ) \left (\cos ^{2}\left (a \right )+\sin ^{2}\left (a \right )\right )}+\frac {\left (\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right ) \ln \left (-\tan \left (b x +a \right ) \cos \left (a \right ) \sin \left (c \right )+\tan \left (b x +a \right ) \sin \left (a \right ) \cos \left (c \right )+\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right )}{\left (\cos ^{2}\left (a \right )\right ) \left (\cos ^{2}\left (c \right )\right )+\left (\cos ^{2}\left (c \right )\right ) \left (\sin ^{2}\left (a \right )\right )+\left (\cos ^{2}\left (a \right )\right ) \left (\sin ^{2}\left (c \right )\right )+\left (\sin ^{2}\left (a \right )\right ) \left (\sin ^{2}\left (c \right )\right )}}{b}\) | \(161\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 74 vs.
\(2 (26) = 52\).
time = 0.29, size = 74, normalized size = 2.85 \begin {gather*} \frac {2 \, b x \cos \left (-a + c\right ) - \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, c\right ) + \cos \left (2 \, c\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, c\right ) + \sin \left (2 \, c\right )^{2}\right ) \sin \left (-a + c\right )}{2 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.14, size = 31, normalized size = 1.19 \begin {gather*} \frac {b x \cos \left (-a + c\right ) - \log \left (-\cos \left (b x + c\right )\right ) \sin \left (-a + c\right )}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 182 vs.
\(2 (20) = 40\).
time = 5.13, size = 435, normalized size = 16.73 \begin {gather*} - \left (\begin {cases} - x & \text {for}\: c = \frac {\pi }{2} \\x & \text {for}\: c = - \frac {\pi }{2} \\0 & \text {for}\: b = 0 \\- \frac {2 b x \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \sin {\left (a \right )} + \left (\begin {cases} - \frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = \frac {\pi }{2} \\\frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = - \frac {\pi }{2} \\\frac {x}{\cos {\left (c \right )}} & \text {for}\: b = 0 \\- \frac {b x \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {b x}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {2 \log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \cos {\left (a \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 440 vs.
\(2 (26) = 52\).
time = 0.44, size = 440, normalized size = 16.92 \begin {gather*} \frac {\frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1\right )} {\left (b x + a\right )}}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} - \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )\right )} \log \left (\tan \left (b x + a\right )^{2} + 1\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} + \frac {2 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) - 4 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) + \tan \left (\frac {1}{2} \, c\right )^{2}\right )} \log \left ({\left | 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, c\right ) + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1 \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{3} - \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )}}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.04, size = 109, normalized size = 4.19 \begin {gather*} x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+\frac {\ln \left ({\mathrm {e}}^{a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________